--------------------------------------------------------
--  File created - Wednesday-September-27-2023   
--------------------------------------------------------
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_BOM_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_BOM_D" ("SYS_GEN_LINE_BOM_ID", "SYS_GEN_LINE_BOM_PARENT_ID", "SYS_GEN_LINE_BOM_PART_NUMBER", "SYS_GEN_LINE_BOM_ITEM_QUANTITY", "SYS_GEN_LINE_BOM_LEVEL", "SYS_GEN_LINE_BOM_EFFECTIVE_DATE") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.SYS_GEN_line_bom_id SYS_GEN_line_bom_id,
    T1.SYS_GEN_line_bom_parent_id SYS_GEN_line_bom_parent_id,
    --T1.SYS_GEN_line_bom_attributes SYS_GEN_line_bom_attributes,
    T1.SYS_GEN_line_bom_part_number SYS_GEN_line_bom_part_number,
    T1.SYS_GEN_line_bom_item_quantity SYS_GEN_line_bom_item_quantity,
    T1.SYS_GEN_line_bom_level SYS_GEN_line_bom_level,
    T1.SYS_GEN_line_bom_effective_date SYS_GEN_line_bom_effective_date
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_BOM_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_BOM_HIER
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_BOM_HIER" ("HRCH_CTGY_ID", "HRCH_CTGY_NM", "HRCH_ID", "HRCH_NM", "LVL_MIN_NUM", "LVL_MAX_NUM", "LEAF_ID", "HRCH_1_ID", "HRCH_1_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_2_ID", "HRCH_2_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_3_ID", "HRCH_3_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_4_ID", "HRCH_4_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_5_ID", "HRCH_5_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_6_ID", "HRCH_6_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_7_ID", "HRCH_7_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_8_ID", "HRCH_8_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_9_ID", "HRCH_9_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_10_ID", "HRCH_10_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_11_ID", "HRCH_11_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_12_ID", "HRCH_12_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_13_ID", "HRCH_13_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_14_ID", "HRCH_14_SYS_GEN_LINE_BOM_PART_NUMBER", "HRCH_15_ID", "HRCH_15_SYS_GEN_LINE_BOM_PART_NUMBER", "W$_INSERT_DT", "W$_UPDATE_DT", "DATA_SRC_NM") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
--DW_SAR_X_SF_HRCH_SEQ.NEXTVAL HRCH_DIM_ID,
    'CPQ_HIER'                    hrch_ctgy_id,
    'CPQ Hierarchy'                 hrch_ctgy_nm,
    'CPQ'                    hrch_id,
    'CPQ Line BOM Tree' hrch_nm,
    0                         lvl_min_num,
    15                        lvl_max_num,
    coalesce(
        lev15.SYS_GEN_LINE_BOM_ID,
        lev14.SYS_GEN_LINE_BOM_ID,
        lev13.SYS_GEN_LINE_BOM_ID,
        lev12.SYS_GEN_LINE_BOM_ID,
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         leaf_id,
    lev01.SYS_GEN_LINE_BOM_ID                  hrch_1_id,
    lev01.SYS_GEN_LINE_BOM_PART_NUMBER                hrch_1_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_2_id,
    coalesce(
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_2_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_3_id,
    coalesce(
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_3_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_4_id,
    coalesce(
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_4_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_5_id,
    coalesce(
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_5_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_6_id,
    coalesce(
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_6_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_7_id,
    coalesce(
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_7_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_8_id,
    coalesce(
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_8_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_9_id,
    coalesce(
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_9_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_10_id,
    coalesce(
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_10_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_11_id,
    coalesce(
        lev11.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_11_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev12.SYS_GEN_LINE_BOM_ID,
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_12_id,
    coalesce(
        lev12.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev11.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_12_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev13.SYS_GEN_LINE_BOM_ID,
        lev12.SYS_GEN_LINE_BOM_ID,
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_13_id,
    coalesce(
        lev13.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev12.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev11.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_13_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev14.SYS_GEN_LINE_BOM_ID,
        lev13.SYS_GEN_LINE_BOM_ID,
        lev12.SYS_GEN_LINE_BOM_ID,
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_14_id,
    coalesce(
        lev14.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev13.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev12.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev11.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_14_SYS_GEN_LINE_BOM_PART_NUMBER,
    coalesce(
        lev15.SYS_GEN_LINE_BOM_ID,
        lev14.SYS_GEN_LINE_BOM_ID,
        lev13.SYS_GEN_LINE_BOM_ID,
        lev12.SYS_GEN_LINE_BOM_ID,
        lev11.SYS_GEN_LINE_BOM_ID,
        lev10.SYS_GEN_LINE_BOM_ID,
        lev09.SYS_GEN_LINE_BOM_ID,
        lev08.SYS_GEN_LINE_BOM_ID,
        lev07.SYS_GEN_LINE_BOM_ID,
        lev06.SYS_GEN_LINE_BOM_ID,
        lev05.SYS_GEN_LINE_BOM_ID,
        lev04.SYS_GEN_LINE_BOM_ID,
        lev03.SYS_GEN_LINE_BOM_ID,
        lev02.SYS_GEN_LINE_BOM_ID,
        lev01.SYS_GEN_LINE_BOM_ID
    )                         hrch_15_id,
    coalesce(
        lev15.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev14.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev13.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev12.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev11.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev10.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev09.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev08.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev07.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev06.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev05.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev04.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev03.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev02.SYS_GEN_LINE_BOM_PART_NUMBER,
        lev01.SYS_GEN_LINE_BOM_PART_NUMBER
    )                         hrch_15_SYS_GEN_LINE_BOM_PART_NUMBER,
    sysdate                   w$_insert_dt,
    sysdate                   w$_update_dt,
    'CPQ'              data_src_nm
FROM
    oax$oac.DW_CPQ_X_LINE_DA1 lev01
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev02 ON lev01.SYS_GEN_LINE_BOM_ID = lev02.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev03 ON lev02.SYS_GEN_LINE_BOM_ID = lev03.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev04 ON lev03.SYS_GEN_LINE_BOM_ID = lev04.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev05 ON lev04.SYS_GEN_LINE_BOM_ID = lev05.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev06 ON lev05.SYS_GEN_LINE_BOM_ID = lev06.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev07 ON lev06.SYS_GEN_LINE_BOM_ID = lev07.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev08 ON lev07.SYS_GEN_LINE_BOM_ID = lev08.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev09 ON lev08.SYS_GEN_LINE_BOM_ID = lev09.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev10 ON lev09.SYS_GEN_LINE_BOM_ID = lev10.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev11 ON lev10.SYS_GEN_LINE_BOM_ID = lev11.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev12 ON lev11.SYS_GEN_LINE_BOM_ID = lev11.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev13 ON lev12.SYS_GEN_LINE_BOM_ID = lev12.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev14 ON lev12.SYS_GEN_LINE_BOM_ID = lev13.SYS_GEN_LINE_BOM_PARENT_ID
    LEFT OUTER JOIN oax$oac.DW_CPQ_X_LINE_DA1 lev15 ON lev14.SYS_GEN_LINE_BOM_ID = lev14.SYS_GEN_LINE_BOM_PARENT_ID
WHERE
    lev01.SYS_GEN_LINE_BOM_PARENT_ID IS NULL
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_BOM_HIER" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_CONTRACT_END_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_CONTRACT_END_DATE_D" ("CONTRACTENDDATE_L", "CONTRACT_END_DATE_KEY", "CONTRACT_END_WEEK_NUM", "CONTRACT_END_WEEK_KEY", "CONTRACT_END_MONTH_NUM", "CONTRACT_END_MONTH_NAME", "CONTRACT_END_MONTH_KEY", "CONTRACT_END_QUARTER_NUM", "CONTRACT_END_QUARTER_NAME", "CONTRACT_END_QUARTER_KEY", "CONTRACT_END_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.CONTRACTENDDATE_L,
    EXTRACT(YEAR FROM CONTRACTENDDATE_L)*10000 + EXTRACT(MONTH FROM CONTRACTENDDATE_L)*100 + EXTRACT(DAY FROM CONTRACTENDDATE_L) CONTRACT_END_DATE_KEY,
    TO_CHAR( CONTRACTENDDATE_L, 'WW') CONTRACT_END_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTENDDATE_L)) || 'W' || TO_CHAR( CONTRACTENDDATE_L, 'WW') CONTRACT_END_WEEK_KEY,
    EXTRACT(MONTH FROM CONTRACTENDDATE_L) CONTRACT_END_MONTH_NUM,
    TO_CHAR(CONTRACTENDDATE_L, 'MONTH') CONTRACT_END_MONTH_NAME,
    EXTRACT(YEAR FROM CONTRACTENDDATE_L)*100 + EXTRACT(MONTH FROM CONTRACTENDDATE_L)   CONTRACT_END_MONTH_KEY,
    TO_CHAR(CONTRACTENDDATE_L,'Q') CONTRACT_END_QUARTER_NUM,
    'Q' || TO_CHAR(CONTRACTENDDATE_L,'Q') CONTRACT_END_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTENDDATE_L)) || 'Q' || TO_CHAR(CONTRACTENDDATE_L,'Q') CONTRACT_END_QUARTER_KEY,
    EXTRACT(YEAR FROM CONTRACTENDDATE_L) CONTRACT_END_YEAR
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_CONTRACT_END_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_CONTRACT_START_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_CONTRACT_START_DATE_D" ("CONTRACTSTARTDATE_L", "CONTRACT_START_DATE_KEY", "CONTRACT_START_WEEK_NUM", "CONTRACT_START_WEEK_KEY", "CONTRACT_START_MONTH_NUM", "CONTRACT_START_MONTH_NAME", "CONTRACT_START_MONTH_KEY", "CONTRACT_START_QUARTER_NUM", "CONTRACT_START_QUARTER_NAME", "CONTRACT_START_QUARTER_KEY", "CONTRACT_START_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_L ,
    T1.CONTRACTSTARTDATE_L,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_L)*10000 + EXTRACT(MONTH FROM CONTRACTSTARTDATE_L)*100 + EXTRACT(DAY FROM CONTRACTSTARTDATE_L) CONTRACT_START_DATE_KEY,
    TO_CHAR( CONTRACTSTARTDATE_L, 'WW') CONTRACT_START_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTSTARTDATE_L)) || 'W' || TO_CHAR( CONTRACTSTARTDATE_L, 'WW') CONTRACT_START_WEEK_KEY,
    EXTRACT(MONTH FROM CONTRACTSTARTDATE_L) CONTRACT_START_MONTH_NUM,
    TO_CHAR(CONTRACTSTARTDATE_L, 'MONTH') CONTRACT_START_MONTH_NAME,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_L)*100 + EXTRACT(MONTH FROM CONTRACTSTARTDATE_L)   CONTRACT_START_MONTH_KEY,
    TO_CHAR(CONTRACTSTARTDATE_L,'Q') CONTRACT_START_QUARTER_NUM,
    'Q' || TO_CHAR(CONTRACTSTARTDATE_L,'Q') CONTRACT_START_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTSTARTDATE_L)) || 'Q' || TO_CHAR(CONTRACTSTARTDATE_L,'Q') CONTRACT_START_QUARTER_KEY,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_L) CONTRACT_START_YEAR
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_CONTRACT_START_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_CREATED_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_CREATED_DATE_D" ("CREATEDDATE_L", "CREATED_DATE_KEY", "CREATED_WEEK_NUM", "CREATED_WEEK_KEY", "CREATED_MONTH_NUM", "CREATED_MONTH_NAME", "CREATED_MONTH_KEY", "CREATED_QUARTER_NUM", "CREATED_QUARTER_NAME", "CREATED_QUARTER_KEY", "CREATED_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.CREATEDDATE_L,
    EXTRACT(YEAR FROM CREATEDDATE_L)*10000 + EXTRACT(MONTH FROM CREATEDDATE_L)*100 + EXTRACT(DAY FROM CREATEDDATE_L) CREATED_DATE_KEY,
    TO_CHAR( CREATEDDATE_L, 'WW') CREATED_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CREATEDDATE_L)) || 'W' || TO_CHAR( CREATEDDATE_L, 'WW') CREATED_WEEK_KEY,
    EXTRACT(MONTH FROM CREATEDDATE_L) CREATED_MONTH_NUM,
    TO_CHAR(CREATEDDATE_L, 'MONTH') CREATED_MONTH_NAME,
    EXTRACT(YEAR FROM CREATEDDATE_L)*100 + EXTRACT(MONTH FROM CREATEDDATE_L)   CREATED_MONTH_KEY,
    TO_CHAR(CREATEDDATE_L,'Q') CREATED_QUARTER_NUM,
    'Q' || TO_CHAR(CREATEDDATE_L,'Q') CREATED_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CREATEDDATE_L)) || 'Q' || TO_CHAR(CREATEDDATE_L,'Q') CREATED_QUARTER_KEY,
    EXTRACT(YEAR FROM CREATEDDATE_L) CREATED_YEAR
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_CREATED_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_D" ("TRANSACTIONID_L", "SYS_GEN_BS_ID", "SYS_GEN_DOCUMENT_NUMBER", "CANCELREASON_L", "CONTRACTEDPERIODS_L", "CONTRACTSTARTDATE_L", "CONTRACTENDDATE_L", "CONTRACTEDPERIODSROLLUP_L", "SYS_GEN_CONFIGURATION_ID", "SYS_GEN_CONFIG_ATTRIBUTES", "SYS_GEN_CONFIG_ATTR_TEXT", "SYS_GEN_CONFIG_ATTR_INFO", "SYS_GEN_CONFIG_ATTR_VALUES", "SYS_GEN_CONFIG_EXTRA_INFO", "CREATEDBY_L", "CREATEDDATE_L", "CUSTOMDISCOUNTTYPE_L", "SYS_GEN_PRICE_DISCOUNT_COMMENT", "CUSTOMERITEMNAME_L", "DISPLAYEDITEMNAME_L", "ITEMINSTANCEID_L", "ITEMINSTANCENAME_L", "LASTUPDATEDBY_L", "LASTUPDATEDDATE_L", "PRICEPERIOD_L", "PRICESCORE_L", "PRICETYPE_L", "PRICETYPEROLLUP_L", "PRICERECURFREQUENCYROLLUP_L", "PRICEWITHINPOLICY_L", "SYS_GEN_SEQUENCE_NUMBER", "SYS_GEN_GROUP_SEQUENCE_NUMBER", "STATUS_L", "STATUSQUANTITY_L", "STATUSDATE_L", "TAXEXEMPT_L", "TAXEXEMPTREASON_L", "UNITCOST_L", "REQUESTEDUNITOFMEASURE_L", "WINLOSSSTATUS_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.transactionID_l  ,
    TO_CHAR(T1.SYS_GEN_BS_ID)  SYS_GEN_BS_ID,
    T1.SYS_GEN_DOCUMENT_NUMBER,
    T1.cancelReason_l  ,
    T1.contractedPeriods_l  ,
    T1.contractStartDate_l ,
    T1.contractEndDate_l ,
    T1.contractedPeriodsRollup_l ,
    T1.SYS_GEN_configuration_id SYS_GEN_configuration_id,
    T1.SYS_GEN_config_attributes SYS_GEN_config_attributes,
    T1.SYS_GEN_config_attr_text SYS_GEN_config_attr_text,
    T1.SYS_GEN_config_attr_info SYS_GEN_config_attr_info,
    T1.SYS_GEN_config_attr_values SYS_GEN_config_attr_values,
    T1.SYS_GEN_config_extra_info SYS_GEN_config_extra_info,
    T1.createdBy_l ,
    T1.createdDate_l ,
    T1.customDiscountType_l ,
    T1.SYS_GEN_price_discount_comment SYS_GEN_price_discount_comment,
    T1.customerItemName_l ,
    T1.displayedItemName_l ,
    T1.itemInstanceId_l ,
    T1.itemInstanceName_l ,
    T1.lastUpdatedBy_l ,
    T1.lastUpdatedDate_l ,
    T1.pricePeriod_l ,
    T1.priceScore_l ,
    T1.priceType_l ,
    T1.priceTypeRollup_l ,
    T1.priceRecurFrequencyRollup_l ,
    T1.priceWithinPolicy_l ,
    T1.SYS_GEN_sequence_number SYS_GEN_sequence_number,
    T1.SYS_GEN_group_sequence_number SYS_GEN_group_sequence_number,
    T1.status_l ,
    T1.statusQuantity_l ,
    T1.statusDate_l ,
    T1.taxExempt_l ,
    T1.taxExemptReason_l ,
    T1.unitCost_l ,
    T1.requestedUnitOfMeasure_l ,
    T1.winLossStatus_l 
    --T3.winProbabilityPct_I 
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_ERP_SALES_ORDER_LINE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_ERP_SALES_ORDER_LINE_D" ("ORCL_ERP_LINEID_L", "ORCL_ERP_SHIPPINGINSTR_L", "ORCL_ERP_PACKINGINSTR_L", "ORCL_ERP_REQUESTSHIPDATE_L", "ORCL_ERP_SHIPPINGCHARGES_L", "ORCL_ERP_BILLINGINSTR_L", "ORCL_ERP_SHIPSET_L", "ORCL_ERP_FIRSTOVERRIDEPERIOD_L", "ORCL_ERP_SECONDOVERRIDEPERIOD_L", "ORCL_ERP_THIRDOVERRIDEPERIOD_L", "ORCL_ERP_FOURTHOVERRIDEPERIOD_L", "ORCL_ERP_FIFTHOVERRIDEPERIOD_L", "FIRSTRECURRINGINVOICEDATE_L", "ORCL_ERP_SECONDRECURRINGINVOICEDATE_L", "ORCL_ERP_SECONDBILLINGPERIODSTARTDATE_L", "ORCL_ERP_CANCELLATIONEFFECTIVEDATE_L", "ORCL_ERP_INVENTORYAVAILABILITY_L", "ORCL_ERP_AVAILABLEQUANTITY_L", "ORCL_ERP_RESERVATIONID_L", "ORCL_ERP_RESERVATIONSTATUS_L", "ORCL_ERP_RESERVATIONQUANTITY_L", "ORCL_ERP_RESERVATIONDATE_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.oRCL_ERP_LineID_l,
    T1.oRCL_ERP_ShippingInstr_l,
    T1.oRCL_ERP_PackingInstr_l,
    T1.oRCL_ERP_RequestShipDate_l,
    T1.oRCL_ERP_ShippingCharges_l,
    T1.oRCL_ERP_BillingInstr_l,
    T1.oRCL_ERP_ShipSet_l,
    T1.oRCL_ERP_FirstOverridePeriod_l,
    T1.oRCL_ERP_SecondOverridePeriod_l,
    T1.oRCL_ERP_ThirdOverridePeriod_l,
    T1.oRCL_ERP_FourthOverridePeriod_l,
    T1.oRCL_ERP_FifthOverridePeriod_l,
    T1.firstRecurringInvoiceDate_l,
    T1.oRCL_ERP_SecondRecurringInvoiceDate_l,
    T1.oRCL_ERP_SecondBillingPeriodStartDate_l,
    T1.oRCL_ERP_CancellationEffectiveDate_l,
    T1.oRCL_ERP_InventoryAvailability_l,
    T1.oRCL_ERP_AvailableQuantity_l,
    T1.oRCL_ERP_ReservationID_l,
    T1.oRCL_ERP_ReservationStatus_l,
    T1.oRCL_ERP_ReservationQuantity_l,
    T1.oRCL_ERP_ReservationDate_l  
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_ERP_SALES_ORDER_LINE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_F
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_F" ("CREATEDDATE_L", "CONTRACTSTARTDATE_L", "CONTRACTENDDATE_L", "ORCL_OSC_REVNID_L", "SYS_GEN_LINE_BOM_ID", "TRANSACTIONID_L", "SYS_GEN_BS_ID", "SYS_GEN_DOCUMENT_NUMBER", "ORCL_ERP_LINEID_L", "FULFILLMENTSTATUS_L", "SYS_GEN_PART_NUMBER", "SYS_GEN_MODEL_NAME", "SYS_GEN_PRICE_BOOK_VAR_NAME", "ORCL_OSC_INVENTORYITEMID_L", "ACTUALAMOUNT_L", "ACTUALQUANTITY_L", "ANNUALVALUE_L", "CONTRACTVALUE_L", "COSTAMOUNT_L", "CUSTOMDISCOUNTAMOUNT_L", "CUSTOMDISCOUNTVALUE_L", "LISTAMOUNT_L", "LISTPRICE_L", "NETAMOUNT_L", "NETPRICE_L", "REQUESTEDQUANTITY_L", "ORCL_ERP_FIRSTOVERRIDEAMOUNT_L", "ORCL_ERP_SECONDOVERRIDEAMOUNT_L", "ORCL_ERP_THIRDOVERRIDEAMOUNT_L", "ORCL_ERP_FOURTHOVERRIDEAMOUNT_L", "ORCL_ERP_FIFTHOVERRIDEAMOUNT_L", "ANNUALDISCOUNT_L", "CONTRACTDISCOUNT_L", "DISCOUNTAMOUNT_L", "ANNUALLISTVALUE_L", "CONTRACTLISTVALUE_L", "UNITMARGIN_L", "MARGINAMOUNT_L", "MARGINPERCENT_L", "ANNUALCOST_L", "CONTRACTCOST_L", "ANNUALMARGIN_L", "CONTRACTMARGIN_L", "SYS_GEN_PRICE_QUANTITY", "SYS_GEN_PRICE_ITEM_PRICE_EACH", "SYS_GEN_PRICE_LIST_PRICE_EACH", "SYS_GEN_PRICING_RULE_PRICE_EACH", "SYS_GEN_PRICE_UNIT_PRICE_EACH", "SYS_GEN_PRICE_SUBTOTAL", "SYS_GEN_PRICE_DISCOUNT_PERCENT", "SYS_GEN_PRICE_TOTAL_DISCOUNT", "SYS_GEN_PRICE_NET_PRICE", "SYS_GEN_PRICE_OVERRIDE_PRICE", "SYS_GEN_PRICE_OVERRIDE_DISCOUNT", "SYS_GEN_PRICE_CONFIGURABLE_PRICE", "SYS_GEN_PRICE_COMPONENT_PRICES", "SYS_GEN_PRICE_OVERRIDE_QUANTITY", "NONRECURREVSUMMABLE_L", "RECURRINGREVSUMMABLE_L", "USAGEREVSUMMABLE_L", "MONTHLYRECURREVSUMMABLE_L", "MONTHLYUSAGEREVSUMMABLE_L", "PRICETYPEROLLUP_L", "PRICERECURFREQUENCYROLLUP_L", "CONTRACTEDPERIODSROLLUP_L", "LISTPRICEROLLUP_L", "NETPRICEROLLUP_L", "NETAMOUNTROLLUP_L", "DISCOUNTPERCENTROLLUP_L", "NONRECURREVROLLUP_L", "RECURREVROLLUP_L", "USAGEREVROLLUP_L", "CONTRACTVALUEROLLUP_L", "MONTHLYRECURREVROLLUP_L", "MONTHLYUSAGEREVROLLUP_L", "CONTRACTLISTVALUEROLLUP_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.CREATEDDATE_L,
    T1.CONTRACTSTARTDATE_L,
    T1.CONTRACTENDDATE_L,
    --T1.REQUESTEDDATE_L,
    T1.oRCL_OSC_RevnId_l oRCL_OSC_RevnId_l,
    T1.SYS_GEN_line_bom_id SYS_GEN_line_bom_id,
    T1.transactionID_l  ,
    TO_CHAR(T1.SYS_GEN_BS_ID)  SYS_GEN_BS_ID,
    T1.SYS_GEN_DOCUMENT_NUMBER,
    --T3.subscriptionId_l ,
    --T3.oRCL_SFDC_ExternalID_l  ,
    --T3.subscriptionId_l ,
    --T3.subscriptionLineId_l  ,
    T1.oRCL_ERP_LineID_l,
    T1.fulfillmentStatus_l,
    T2.SYS_GEN_part_number SYS_GEN_part_number,
    T1.SYS_GEN_model_name SYS_GEN_model_name,
    --T1.SYS_GEN_product_line_id SYS_GEN_product_line_id,
    T2.SYS_GEN_price_book_var_name SYS_GEN_price_book_var_name,
    T2.oRCL_OSC_InventoryItemID_l oRCL_OSC_InventoryItemID_l,
    T2.actualAmount_l actualAmount_l,
    T2.actualQuantity_l actualQuantity_l,
    T2.annualValue_l annualValue_l,
    T2.contractValue_l contractValue_l,
    T2.costAmount_l costAmount_l,
    T2.customDiscountAmount_l customDiscountAmount_l,
    T2.customDiscountValue_l customDiscountValue_l,
    T2.listAmount_l listAmount_l,
    T2.listPrice_l listPrice_l,
    T2.netAmount_l netAmount_l,
    T2.netPrice_l netPrice_l,
    T2.requestedQuantity_l requestedQuantity_l,
    T1.oRCL_ERP_FirstOverrideAmount_l oRCL_ERP_FirstOverrideAmount_l,
    T1.oRCL_ERP_SecondOverrideAmount_l oRCL_ERP_SecondOverrideAmount_l,
    T1.oRCL_ERP_ThirdOverrideAmount_l oRCL_ERP_ThirdOverrideAmount_l,
    T1.oRCL_ERP_FourthOverrideAmount_l oRCL_ERP_FourthOverrideAmount_l,
    T1.oRCL_ERP_FifthOverrideAmount_l oRCL_ERP_FifthOverrideAmount_l,
    T2.annualDiscount_l annualDiscount_l,
    T2.contractDiscount_l contractDiscount_l,
    T2.discountAmount_l discountAmount_l,
    T2.annualListValue_l annualListValue_l,
    T2.contractListValue_l contractListValue_l,
    T2.unitMargin_l unitMargin_l,
    T2.marginAmount_l marginAmount_l,
    T2.marginPercent_l marginPercent_l,
    T2.annualCost_l annualCost_l,
    T2.contractCost_l contractCost_l,
    T2.annualMargin_l annualMargin_l,
    T2.contractMargin_l contractMargin_l,
    T2.SYS_GEN_price_quantity SYS_GEN_price_quantity,
    T2.SYS_GEN_price_item_price_each SYS_GEN_price_item_price_each,
    T2.SYS_GEN_price_list_price_each SYS_GEN_price_list_price_each,
    T2.SYS_GEN_pricing_rule_price_each SYS_GEN_pricing_rule_price_each,
    T2.SYS_GEN_price_unit_price_each SYS_GEN_price_unit_price_each,
    T2.SYS_GEN_price_subtotal SYS_GEN_price_subtotal,
    T2.SYS_GEN_price_discount_percent SYS_GEN_price_discount_percent,
    T2.SYS_GEN_price_total_discount SYS_GEN_price_total_discount,
    T2.SYS_GEN_price_net_price SYS_GEN_price_net_price,
    T2.SYS_GEN_price_override_price SYS_GEN_price_override_price,
    T2.SYS_GEN_price_override_discount SYS_GEN_price_override_discount,
    T2.SYS_GEN_price_configurable_price SYS_GEN_price_configurable_price,
    T2.SYS_GEN_price_component_prices SYS_GEN_price_component_prices,
    T2.SYS_GEN_price_override_quantity SYS_GEN_price_override_quantity,
    T2.nonRecurRevSummable_l nonRecurRevSummable_l,
    T2.recurringRevSummable_l recurringRevSummable_l,
    T2.usageRevSummable_l usageRevSummable_l,
    T2.monthlyRecurRevSummable_l monthlyRecurRevSummable_l,
    T2.monthlyUsageRevSummable_l monthlyUsageRevSummable_l,
    T3.priceTypeRollup_l priceTypeRollup_l,
    T3.priceRecurFrequencyRollup_l priceRecurFrequencyRollup_l,
    T3.contractedPeriodsRollup_l contractedPeriodsRollup_l,
    T3.listPriceRollup_l listPriceRollup_l,
    T3.netPriceRollup_l netPriceRollup_l,
    T3.netAmountRollup_l netAmountRollup_l,
    T3.discountPercentRollup_l discountPercentRollup_l,
    T3.nonRecurRevRollup_l nonRecurRevRollup_l,
    T3.recurRevRollup_l recurRevRollup_l,
    T3.usageRevRollup_l usageRevRollup_l,
    T3.contractValueRollup_l contractValueRollup_l,
    T3.monthlyRecurRevRollup_l monthlyRecurRevRollup_l,
    T3.monthlyUsageRevRollup_l monthlyUsageRevRollup_l,
    T3.contractListValueRollup_l contractListValueRollup_l
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1,
    OAX$OAC.DW_CPQ_X_LINE_DA2 T2,
    OAX$OAC.DW_CPQ_X_LINE_DA3 T3
WHERE   
    T1.SYS_GEN_bs_id = T2.SYS_GEN_bs_id AND T1.SYS_GEN_DOCUMENT_NUMBER = T2.SYS_GEN_DOCUMENT_NUMBER AND
    T1.SYS_GEN_bs_id = T3.SYS_GEN_bs_id AND T1.SYS_GEN_DOCUMENT_NUMBER = T3.SYS_GEN_DOCUMENT_NUMBER
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_F" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_FULFILLMENT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_FULFILLMENT_D" ("FULFILLMENTSTATUS_L", "REQUESTDATE_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.fulfillmentStatus_l,
    T1.requestDate_l
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_FULFILLMENT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_INVENTORY_ITEM_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_INVENTORY_ITEM_D" ("ORCL_OSC_INVENTORYITEMID_L", "ORCL_OSC_INVENTORYORGID_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T2.oRCL_OSC_InventoryItemID_l oRCL_OSC_InventoryItemID_l,
    T2.oRCL_OSC_InventoryOrgID_l oRCL_OSC_InventoryOrgID_l
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA2 T2
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_INVENTORY_ITEM_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_ITEM_PART_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_ITEM_PART_D" ("SYS_GEN_PART_NUMBER", "SYS_GEN_PART_DESC", "SYS_GEN_PART_EXTENDED_DESC_1", "SYS_GEN_PART_EXTENDED_DESC_2", "SYS_GEN_PART_BASE_PRICE", "SYS_GEN_PART_UNITS", "SYS_GEN_PART_LEAD_TIME", "SYS_GEN_PART_SUPPLIER_COMPANY_NAME", "SYS_GEN_PART_CUSTOM_FIELD1", "SYS_GEN_PART_CUSTOM_FIELD2", "SYS_GEN_PART_CUSTOM_FIELD3", "SYS_GEN_PART_CUSTOM_FIELD4", "SYS_GEN_PART_CUSTOM_FIELD5", "SYS_GEN_PART_CUSTOM_FIELD6", "SYS_GEN_PART_CUSTOM_FIELD7", "SYS_GEN_PART_CUSTOM_FIELD8", "SYS_GEN_PART_CUSTOM_FIELD9", "SYS_GEN_PART_CUSTOM_FIELD10", "SYS_GEN_PART_CUSTOM_FIELD11", "SYS_GEN_PART_CUSTOM_FIELD12", "SYS_GEN_PART_CUSTOM_FIELD13", "SYS_GEN_PART_CUSTOM_FIELD14", "SYS_GEN_PART_CUSTOM_FIELD15", "SYS_GEN_PART_CUSTOM_FIELD16", "SYS_GEN_PART_CUSTOM_FIELD17", "SYS_GEN_PART_CUSTOM_FIELD18", "SYS_GEN_PART_CUSTOM_FIELD19", "SYS_GEN_PART_CUSTOM_FIELD20", "SYS_GEN_PART_CUSTOM_FIELD21", "SYS_GEN_PART_CUSTOM_FIELD22", "SYS_GEN_PART_CUSTOM_FIELD23", "SYS_GEN_PART_CUSTOM_FIELD24", "SYS_GEN_PART_CUSTOM_FIELD25", "SYS_GEN_PART_CUSTOM_FIELD26", "SYS_GEN_PART_CUSTOM_FIELD27", "SYS_GEN_PART_CUSTOM_FIELD28", "SYS_GEN_PART_CUSTOM_FIELD29", "SYS_GEN_PART_CUSTOM_FIELD30", "SYS_GEN_PART_DRAWING_POSITION", "SYS_GEN_PART_DIRECT_BUY", "SYS_GEN_PART_DISPLAY_NUMBER", "SYS_GEN_PART_COMPANY_ASSOCIATIONS") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T2.SYS_GEN_part_number SYS_GEN_part_number,
    T2.SYS_GEN_part_desc SYS_GEN_part_desc,
    T2.SYS_GEN_part_extended_desc_1 SYS_GEN_part_extended_desc_1,
    T2.SYS_GEN_part_extended_desc_2 SYS_GEN_part_extended_desc_2,
    T2.SYS_GEN_part_base_price SYS_GEN_part_base_price,
    T2.SYS_GEN_part_units SYS_GEN_part_units,
    T2.SYS_GEN_part_lead_time SYS_GEN_part_lead_time,
    T2.SYS_GEN_part_supplier_company_name SYS_GEN_part_supplier_company_name,
    T2.SYS_GEN_part_custom_field1 SYS_GEN_part_custom_field1,
    T2.SYS_GEN_part_custom_field2 SYS_GEN_part_custom_field2,
    T2.SYS_GEN_part_custom_field3 SYS_GEN_part_custom_field3,
    T2.SYS_GEN_part_custom_field4 SYS_GEN_part_custom_field4,
    T2.SYS_GEN_part_custom_field5 SYS_GEN_part_custom_field5,
    T2.SYS_GEN_part_custom_field6 SYS_GEN_part_custom_field6,
    T2.SYS_GEN_part_custom_field7 SYS_GEN_part_custom_field7,
    T2.SYS_GEN_part_custom_field8 SYS_GEN_part_custom_field8,
    T2.SYS_GEN_part_custom_field9 SYS_GEN_part_custom_field9,
    T2.SYS_GEN_part_custom_field10 SYS_GEN_part_custom_field10,
    T2.SYS_GEN_part_custom_field11 SYS_GEN_part_custom_field11,
    T2.SYS_GEN_part_custom_field12 SYS_GEN_part_custom_field12,
    T2.SYS_GEN_part_custom_field13 SYS_GEN_part_custom_field13,
    T2.SYS_GEN_part_custom_field14 SYS_GEN_part_custom_field14,
    T2.SYS_GEN_part_custom_field15 SYS_GEN_part_custom_field15,
    T2.SYS_GEN_part_custom_field16 SYS_GEN_part_custom_field16,
    T2.SYS_GEN_part_custom_field17 SYS_GEN_part_custom_field17,
    T2.SYS_GEN_part_custom_field18 SYS_GEN_part_custom_field18,
    T2.SYS_GEN_part_custom_field19 SYS_GEN_part_custom_field19,
    T2.SYS_GEN_part_custom_field20 SYS_GEN_part_custom_field20,
    T2.SYS_GEN_part_custom_field21 SYS_GEN_part_custom_field21,
    T2.SYS_GEN_part_custom_field22 SYS_GEN_part_custom_field22,
    T2.SYS_GEN_part_custom_field23 SYS_GEN_part_custom_field23,
    T2.SYS_GEN_part_custom_field24 SYS_GEN_part_custom_field24,
    T2.SYS_GEN_part_custom_field25 SYS_GEN_part_custom_field25,
    T2.SYS_GEN_part_custom_field26 SYS_GEN_part_custom_field26,
    T2.SYS_GEN_part_custom_field27 SYS_GEN_part_custom_field27,
    T2.SYS_GEN_part_custom_field28 SYS_GEN_part_custom_field28,
    T2.SYS_GEN_part_custom_field29 SYS_GEN_part_custom_field29,
    T2.SYS_GEN_part_custom_field30 SYS_GEN_part_custom_field30,
    T2.SYS_GEN_part_drawing_position SYS_GEN_part_drawing_position,
    T2.SYS_GEN_part_direct_buy SYS_GEN_part_direct_buy,
    --T2.SYS_GEN_partner_entity_id SYS_GEN_partner_entity_id,
    T2.SYS_GEN_part_display_number SYS_GEN_part_display_number,
    T2.SYS_GEN_part_company_associations SYS_GEN_part_company_associations
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA2 T2
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_ITEM_PART_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_MODEL_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_MODEL_D" ("SYS_GEN_MODEL_NAME", "SYS_GEN_MODEL_SEGMENT_ID", "SYS_GEN_MODEL_SEGMENT_NAME", "SYS_GEN_MODEL_SEGMENT_VAR_NAME", "SYS_GEN_MODEL_PRODUCT_LINE_ID", "SYS_GEN_MODEL_PRODUCT_LINE_NAME", "SYS_GEN_MODEL_PRODUCT_LINE_ATTRIBUTES", "SYS_GEN_MODEL_BASE_PRICE", "SYS_GEN_MODEL_SUPPLIER_COMPANY_ID", "SYS_GEN_MODEL_SUPPLIER_COMPANY_NAME", "SYS_GEN_MODEL_BOM", "SYS_GEN_MODEL_VARIABLE_NAME", "SYS_GEN_MODEL_PRODUCT_LINE_VAR_NAME") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.SYS_GEN_model_name SYS_GEN_model_name,
    T1.SYS_GEN_model_segment_id SYS_GEN_model_segment_id,
    T1.SYS_GEN_model_segment_name SYS_GEN_model_segment_name,
    T1.SYS_GEN_model_segment_var_name SYS_GEN_model_segment_var_name,
    T1.SYS_GEN_model_product_line_id SYS_GEN_model_product_line_id,
    T1.SYS_GEN_model_product_line_name SYS_GEN_model_product_line_name,
    T1.SYS_GEN_model_product_line_attributes SYS_GEN_model_product_line_attributes,
    T1.SYS_GEN_model_base_price SYS_GEN_model_base_price,
    T1.SYS_GEN_model_supplier_company_id SYS_GEN_model_supplier_company_id,
    T1.SYS_GEN_model_supplier_company_name SYS_GEN_model_supplier_company_name,
    T1.SYS_GEN_model_bom SYS_GEN_model_bom,
    T1.SYS_GEN_model_variable_name SYS_GEN_model_variable_name,
    T1.SYS_GEN_model_product_line_var_name SYS_GEN_model_product_line_var_name
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_MODEL_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_OPPTY_REVENUE_LINE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_OPPTY_REVENUE_LINE_D" ("ORCL_OSC_REVNID_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.oRCL_OSC_RevnId_l oRCL_OSC_RevnId_l
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_OPPTY_REVENUE_LINE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_OSC_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_OSC_D" ("ORCL_OSC_STATUS_L", "SYS_GEN_BS_ID", "LINETYPE_L", "DISCOUNTPERCENT_L", "ORCL_ERP_ORDERNUMBER_L", "PRICERECURFREQUENCY_L", "ROOTLINE_L", "ROOTASSETKEY_L", "SYS_GEN_CONFIGURATION_ID", "ORCL_ABO_ACTIONCODE_L") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.oRCL_OSC_Status_l  ,
    TO_CHAR(T1.SYS_GEN_BS_ID)  SYS_GEN_BS_ID,
    T1.lineType_l  ,
    T1.discountPercent_l  ,
    T1.oRCL_ERP_OrderNumber_l ,
    T1.priceRecurFrequency_l ,
    T1.rootLine_l ,
    --T3.SYS_GEN_revenueId_l SYS_GEN_revenueId_l,
    --T3.SYS_GEN_revenueCategory_l SYS_GEN_revenueCategory_l,
    T1.rootAssetKey_l,
    --T3.parentAssetKey_l,
    T1.SYS_GEN_configuration_id SYS_GEN_configuration_id,
    --T3.parentAssetKey_l ,
    --T3.ownerResourceId_l ,
    T1.oRCL_ABO_ActionCode_l oRCL_ABO_ActionCode_l
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_OSC_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_LINE_PRICE_BOOK_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_LINE_PRICE_BOOK_D" ("SYS_GEN_PRICE_BOOK_VAR_NAME") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T2.SYS_GEN_price_book_var_name SYS_GEN_price_book_var_name
FROM
    OAX$OAC.DW_CPQ_X_LINE_DA2 T2
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_LINE_PRICE_BOOK_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_APPROVAL_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_APPROVAL_D" ("BS_ID", "APPROVAL_STATUS_SUBMIT_T", "APPROVAL_HISTORY_SUBMIT_T", "APPROVAL_REVISION_SUBMIT_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.bs_id bs_id,
    T2.approval_status_submit_t approval_status_submit_t,
    T2.approval_history_submit_t approval_history_submit_t,
    T2.approval_revision_submit_t approval_revision_submit_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1,
    OAX$OAC.DW_CPQ_X_QUOTE_DA2 T2 
WHERE 
    T1.bs_id = T2.bs_id (+)
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_APPROVAL_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_BILLTO_CUSTOMER_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_BILLTO_CUSTOMER_D" ("INVOICETOPARTYID_T", "SYS_GEN_INVOICETO_T_COMPANY_NAME", "SYS_GEN_INVOICETO_T_COMPANY_NAME_2") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T2.invoiceToPartyID_t , 
    T2.SYS_GEN_INVOICETO_T_COMPANY_NAME ,
    T2.SYS_GEN_INVOICETO_T_COMPANY_NAME_2  
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA2 T2
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_BILLTO_CUSTOMER_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_BUSINESS_UNIT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_BUSINESS_UNIT_D" ("BUSINESSUNITID_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T2.businessUnitId_t businessUnitId_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA2 T2
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_BUSINESS_UNIT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CONTRACT_END_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CONTRACT_END_DATE_D" ("CONTRACTENDDATE_T", "CONTRACT_END_DATE_KEY", "CONTRACT_END_WEEK_NUM", "CONTRACT_END_WEEK_KEY", "CONTRACT_END_MONTH_NUM", "CONTRACT_END_MONTH_NAME", "CONTRACT_END_MONTH_KEY", "CONTRACT_END_QUARTER_NUM", "CONTRACT_END_QUARTER_NAME", "CONTRACT_END_QUARTER_KEY", "CONTRACT_END_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.CONTRACTENDDATE_T,
    EXTRACT(YEAR FROM CONTRACTENDDATE_T)*10000 + EXTRACT(MONTH FROM CONTRACTENDDATE_T)*100 + EXTRACT(DAY FROM CONTRACTENDDATE_T) CONTRACT_END_DATE_KEY,
    TO_CHAR( CONTRACTENDDATE_T, 'WW') CONTRACT_END_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTENDDATE_T)) || 'W' || TO_CHAR( CONTRACTENDDATE_T, 'WW') CONTRACT_END_WEEK_KEY,
    EXTRACT(MONTH FROM CONTRACTENDDATE_T) CONTRACT_END_MONTH_NUM,
    TO_CHAR(CONTRACTENDDATE_T, 'MONTH') CONTRACT_END_MONTH_NAME,
    EXTRACT(YEAR FROM CONTRACTENDDATE_T)*100 + EXTRACT(MONTH FROM CONTRACTENDDATE_T)   CONTRACT_END_MONTH_KEY,
    TO_CHAR(CONTRACTENDDATE_T,'Q') CONTRACT_END_QUARTER_NUM,
    'Q' || TO_CHAR(CONTRACTENDDATE_T,'Q') CONTRACT_END_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTENDDATE_T)) || 'Q' || TO_CHAR(CONTRACTENDDATE_T,'Q') CONTRACT_END_QUARTER_KEY,
    EXTRACT(YEAR FROM CONTRACTENDDATE_T) CONTRACT_END_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CONTRACT_END_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CONTRACT_START_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CONTRACT_START_DATE_D" ("CONTRACTSTARTDATE_T", "CONTRACT_START_DATE_KEY", "CONTRACT_START_WEEK_NUM", "CONTRACT_START_WEEK_KEY", "CONTRACT_START_MONTH_NUM", "CONTRACT_START_MONTH_NAME", "CONTRACT_START_MONTH_KEY", "CONTRACT_START_QUARTER_NUM", "CONTRACT_START_QUARTER_NAME", "CONTRACT_START_QUARTER_KEY", "CONTRACT_START_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.CONTRACTSTARTDATE_T,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_T)*10000 + EXTRACT(MONTH FROM CONTRACTSTARTDATE_T)*100 + EXTRACT(DAY FROM CONTRACTSTARTDATE_T) CONTRACT_START_DATE_KEY,
    TO_CHAR( CONTRACTSTARTDATE_T, 'WW') CONTRACT_START_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTSTARTDATE_T)) || 'W' || TO_CHAR( CONTRACTSTARTDATE_T, 'WW') CONTRACT_START_WEEK_KEY,
    EXTRACT(MONTH FROM CONTRACTSTARTDATE_T) CONTRACT_START_MONTH_NUM,
    TO_CHAR(CONTRACTSTARTDATE_T, 'MONTH') CONTRACT_START_MONTH_NAME,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_T)*100 + EXTRACT(MONTH FROM CONTRACTSTARTDATE_T)   CONTRACT_START_MONTH_KEY,
    TO_CHAR(CONTRACTSTARTDATE_T,'Q') CONTRACT_START_QUARTER_NUM,
    'Q' || TO_CHAR(CONTRACTSTARTDATE_T,'Q') CONTRACT_START_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CONTRACTSTARTDATE_T)) || 'Q' || TO_CHAR(CONTRACTSTARTDATE_T,'Q') CONTRACT_START_QUARTER_KEY,
    EXTRACT(YEAR FROM CONTRACTSTARTDATE_T) CONTRACT_START_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CONTRACT_START_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CREATED_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CREATED_DATE_D" ("CREATEDDATE_T", "CREATED_DATE_KEY", "CREATED_WEEK_NUM", "CREATED_WEEK_KEY", "CREATED_MONTH_NUM", "CREATED_MONTH_NAME", "CREATED_MONTH_KEY", "CREATED_QUARTER_NUM", "CREATED_QUARTER_NAME", "CREATED_QUARTER_KEY", "CREATED_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.CREATEDDATE_T,
    EXTRACT(YEAR FROM CREATEDDATE_T)*10000 + EXTRACT(MONTH FROM CREATEDDATE_T)*100 + EXTRACT(DAY FROM CREATEDDATE_T) CREATED_DATE_KEY,
    TO_CHAR( CREATEDDATE_T, 'WW') CREATED_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM CREATEDDATE_T)) || 'W' || TO_CHAR( CREATEDDATE_T, 'WW') CREATED_WEEK_KEY,
    EXTRACT(MONTH FROM CREATEDDATE_T) CREATED_MONTH_NUM,
    TO_CHAR(CREATEDDATE_T, 'MONTH') CREATED_MONTH_NAME,
    EXTRACT(YEAR FROM CREATEDDATE_T)*100 + EXTRACT(MONTH FROM CREATEDDATE_T)   CREATED_MONTH_KEY,
    TO_CHAR(CREATEDDATE_T,'Q') CREATED_QUARTER_NUM,
    'Q' || TO_CHAR(CREATEDDATE_T,'Q') CREATED_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM CREATEDDATE_T)) || 'Q' || TO_CHAR(CREATEDDATE_T,'Q') CREATED_QUARTER_KEY,
    EXTRACT(YEAR FROM CREATEDDATE_T) CREATED_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CREATED_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CURRENCY_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CURRENCY_D" ("CURRENCY_CODE") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.CURRENCY_T CURRENCY_CODE   
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CURRENCY_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_ACCOUNT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_ACCOUNT_D" ("SOLDTOCUSTOMERACCOUNTID_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.soldToCustomerAccountID_t soldToCustomerAccountID_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_ACCOUNT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_CONTACT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_CONTACT_D" ("CUSTOMERPARTYID_T", "SYS_GEN_CUSTOMER_T_FIRST_NAME", "SYS_GEN_CUSTOMER_T_LAST_NAME", "SYS_GEN_CUSTOMER_T_PHONE", "SYS_GEN_CUSTOMER_T_FAX", "SYS_GEN_CUSTOMER_T_EMAIL") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.customerPartyID_t customerPartyID_t,
    T1.SYS_GEN_customer_t_first_name SYS_GEN_customer_t_first_name ,
    T1.SYS_GEN_customer_t_last_name SYS_GEN_customer_t_last_name ,
    T1.SYS_GEN_customer_t_phone SYS_GEN_customer_t_phone ,
    T1.SYS_GEN_customer_t_fax SYS_GEN_customer_t_fax ,
    T1.SYS_GEN_customer_t_email SYS_GEN_customer_t_email
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_CONTACT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_D" ("CUSTOMERPARTYID_T", "SYS_GEN_CUSTOMER_T_COMPANY_NAME", "SYS_GEN_CUSTOMER_T_COMPANY_NAME_2") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.customerPartyID_t customerPartyID_t, 
    T1.SYS_GEN_customer_t_company_name SYS_GEN_customer_t_company_name,
    T1.SYS_GEN_customer_t_company_name_2 SYS_GEN_customer_t_company_name_2
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_SHIPTO_CONTACT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SHIPTO_CONTACT_D" ("SHIPTOPARTYID_T", "SYS_GEN_SHIPTO_T_FIRST_NAME", "SYS_GEN_SHIPTO_T_LAST_NAME", "SYS_GEN_SHIPTO_T_PHONE", "SYS_GEN_SHIPTO_T_FAX", "SYS_GEN_SHIPTO_T_EMAIL") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.shipToPartyID_t shipToPartyID_t,
    T1.SYS_GEN_shipTo_t_first_name SYS_GEN_shipTo_t_first_name,
    T1.SYS_GEN_shipTo_t_last_name SYS_GEN_shipTo_t_last_name ,
    T1.SYS_GEN_shipTo_t_phone SYS_GEN_shipTo_t_phone ,
    T1.SYS_GEN_shipTo_t_fax SYS_GEN_shipTo_t_fax ,
    T1.SYS_GEN_shipTo_t_email SYS_GEN_shipTo_t_email
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SHIPTO_CONTACT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_D" ("CUSTOMERPARTYSITEID_T", "SYS_GEN_CUSTOMER_T_ADDRESS", "SYS_GEN_CUSTOMER_T_ADDRESS_2", "SYS_GEN_CUSTOMER_T_CITY", "SYS_GEN_CUSTOMER_T_STATE", "SYS_GEN_CUSTOMER_T_ZIP", "SYS_GEN_CUSTOMER_T_COUNTRY") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.customerPartySiteID_t customerPartySiteID_t,
    T1.SYS_GEN_customer_t_address SYS_GEN_customer_t_address ,
    T1.SYS_GEN_customer_t_address_2 SYS_GEN_customer_t_address_2 ,
    T1.SYS_GEN_customer_t_city SYS_GEN_customer_t_city ,
    T1.SYS_GEN_customer_t_state SYS_GEN_customer_t_state ,
    T1.SYS_GEN_customer_t_zip SYS_GEN_customer_t_zip ,
    T1.SYS_GEN_customer_t_country SYS_GEN_customer_t_country
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SHIPTO_DETAILS_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SHIPTO_DETAILS_D" ("SHIPTOPARTYSITEID_T", "SYS_GEN_SHIPTO_T_ADDRESS", "SYS_GEN_SHIPTO_T_ADDRESS_2", "SYS_GEN_SHIPTO_T_CITY", "SYS_GEN_SHIPTO_T_STATE", "SYS_GEN_SHIPTO_T_ZIP", "SYS_GEN_SHIPTO_T_COUNTRY") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.shipToPartySiteID_t shipToPartySiteID_t,
    T1.SYS_GEN_shipTo_t_address SYS_GEN_shipTo_t_address ,
    T1.SYS_GEN_shipTo_t_address_2 SYS_GEN_shipTo_t_address_2 ,
    T1.SYS_GEN_shipTo_t_city SYS_GEN_shipTo_t_city ,
    T1.SYS_GEN_shipTo_t_state SYS_GEN_shipTo_t_state ,
    T1.SYS_GEN_shipTo_t_zip SYS_GEN_shipTo_t_zip ,
    T1.SYS_GEN_shipTo_t_country SYS_GEN_shipTo_t_country
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SHIPTO_DETAILS_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SOLDTO_DETAILS_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SOLDTO_DETAILS_D" ("SOLDTOPARTYSITEID_T", "SYS_GEN_SOLDTO_T_ADDRESS", "SYS_GEN_SOLDTO_T_ADDRESS_2", "SYS_GEN_SOLDTO_T_CITY", "SYS_GEN_SOLDTO_T_STATE", "SYS_GEN_SOLDTO_T_ZIP", "SYS_GEN_SOLDTO_T_COUNTRY") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT
    T1.soldToPartySiteID_t soldToPartySiteID_t,
    T1.SYS_GEN_soldTo_t_address SYS_GEN_soldTo_t_address ,
    T1.SYS_GEN_soldTo_t_address_2 SYS_GEN_soldTo_t_address_2 ,
    T1.SYS_GEN_soldTo_t_city SYS_GEN_soldTo_t_city ,
    T1.SYS_GEN_soldTo_t_state SYS_GEN_soldTo_t_state ,
    T1.SYS_GEN_soldTo_t_zip SYS_GEN_soldTo_t_zip ,
    T1.SYS_GEN_soldTo_t_country SYS_GEN_soldTo_t_country
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SITE_SOLDTO_DETAILS_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_CUSTOMER_SOLDTO_CONTACT_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SOLDTO_CONTACT_D" ("SOLDTOPARTYID_T", "SYS_GEN_SOLDTO_T_FIRST_NAME", "SYS_GEN_SOLDTO_T_LAST_NAME", "SYS_GEN_SOLDTO_T_PHONE", "SYS_GEN_SOLDTO_T_FAX", "SYS_GEN_SOLDTO_T_EMAIL") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.soldToPartyID_t soldToPartyID_t,
    T1.SYS_GEN_soldTo_t_first_name SYS_GEN_soldTo_t_first_name,
    T1.SYS_GEN_soldTo_t_last_name SYS_GEN_soldTo_t_last_name, 
    T1.SYS_GEN_soldTo_t_phone SYS_GEN_soldTo_t_phone ,
    T1.SYS_GEN_soldTo_t_fax SYS_GEN_soldTo_t_fax ,
    T1.SYS_GEN_soldTo_t_email SYS_GEN_soldTo_t_email
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_CUSTOMER_SOLDTO_CONTACT_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_D" ("TRANSACTIONID_T", "USERKEY_T", "VERSION_T", "TRANSACTIONNAME_T", "BS_ID", "CANCELREASON_T", "SYS_GEN_CUSTOMER_ID", "CREATEDBY_T", "CREATEDDATE_T", "ORCL_OSC_TRANSACTIONID_T", "CURRENCY_T", "HASRECURRINGPRICING_T", "LASTPRICEDDATE_T", "LASTUPDATEDBY_T", "LASTUPDATEDDATE_T", "ORDERDATE_T", "OPPORTUNITYID_T", "PAYMENTTERMS_T", "PRICEEXPIRATIONDATE_T", "PRICEWITHINPOLICY_T", "PRIMARYFLAG_T", "REJECTEXPLANATION_T", "REJECTREASON_T", "RENEWALPROCESS_T", "SYS_GEN_REVENUECATEGORY_T", "SALESCHANNEL_T", "STATUS_T", "STATUSDATE_T", "TAXEXEMPT_T", "TAXEXEMPTREASON_T", "TRANSACTIONDESCRIPTION_T", "TRANSACTIONSOURCESYSTEM_T", "WINLOSSSTATUS_T", "WINPROBABILITY_T", "OWNER_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.transactionID_t transactionID_t,
    T1.userKey_t userKey_t,
    T1.version_t version_t ,
    T1.transactionName_t transactionName_t  ,
    T1.bs_id bs_id  ,
    T1.cancelReason_t cancelReason_t  ,
    T1.SYS_GEN_customer_id  SYS_GEN_customer_id ,
    T1.createdBy_t createdBy_t  ,
    T1.createdDate_t createdDate_t  ,
    T1.oRCL_OSC_TransactionID_t oRCL_OSC_TransactionID_t  ,
    T1.currency_t currency_t  ,
    T1.hasRecurringPricing_t hasRecurringPricing_t  ,
    T1.lastPricedDate_t lastPricedDate_t  ,
    T1.lastUpdatedBy_t lastUpdatedBy_t  ,
    T1.lastUpdatedDate_t lastUpdatedDate_t  ,
    T1.ORDERDATE_T,
    T1.opportunityID_t  opportunityID_t ,
    T1.paymentTerms_t paymentTerms_t  ,
    T1.priceExpirationDate_t priceExpirationDate_t  ,
    T1.priceWithinPolicy_t priceWithinPolicy_t  ,
    T1.primaryFlag_t primaryFlag_t  ,
    T1.rejectExplanation_t rejectExplanation_t  ,
    T1.rejectReason_t rejectReason_t  ,
    T1.renewalProcess_t renewalProcess_t  ,
    T1.SYS_GEN_revenueCategory_t SYS_GEN_revenueCategory_t  ,
    T1.salesChannel_t salesChannel_t  ,
    T1.status_t status_t  ,
    T1.statusDate_t statusDate_t  ,
    T1.taxExempt_t taxExempt_t  ,
    T1.taxExemptReason_t taxExemptReason_t  ,
    T1.transactionDescription_t transactionDescription_t  ,
    T1.transactionSourceSystem_t transactionSourceSystem_t  ,
    T1.winLossStatus_t winLossStatus_t  ,
    T1.winProbability_t winProbability_t ,
    T1.owner_t owner_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_F
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_F" ("BS_ID", "CREATEDDATE_T", "ORDERDATE_T", "CONTRACTSTARTDATE_T", "CONTRACTENDDATE_T", "PRICEEXPIRATIONDATE_T", "LASTPRICEDDATE_T", "CUSTOMERPARTYID_T", "SOLDTOPARTYID_T", "SHIPTOPARTYID_T", "SOLDTOCUSTOMERACCOUNTID_T", "CUSTOMERPARTYSITEID_T", "SHIPTOPARTYSITEID_T", "SOLDTOPARTYSITEID_T", "CURRENCY_CODE", "OPPORTUNITYID_T", "TRANSACTIONID_T", "ORCL_OSC_PRIMARYORGID_T", "ORCL_OSC_TRANSACTIONID_T", "ORCL_SFDC_TRANSACTIONID_T", "ORCL_ERP_ORDERID_T", "BUSINESSUNITID_T", "WINLOSSSTATUS_T", "WINPROBABILITY_T", "PROPOSALEXISTS_T", "INVOICETOPARTYID_T", "SYS_GEN_ID", "SYS_GEN_DOCUMENT_NUMBER", "SALESCHANNEL_T", "VERSION_T", "TOTALCONTRACTVALUE_T", "TOTALMONTHLYDISCOUNT_T", "TOTALMONTHLYLISTAMOUNT_T", "TOTALMONTHLYNETAMOUNT_T", "TOTALONETIMEDISCOUNT_T", "TOTALONETIMELISTAMOUNT_T", "TOTALONETIMENETAMOUNT_T", "TOTALANNUALVALUE_T", "SYS_GEN_TRANSACTION_TOTAL", "TOTALCONTRACTDISCOUNT_T", "TOTALANNUALDISCOUNT_T", "TRANSACTIONTOTALDISCOUNTPERCENT_T", "ANNUALCONTRACTLISTVALUE_T", "TRANSACTIONLISTTOTAL_T", "TOTALCONTRACTLISTVALUE_T", "PRICESCORE_T", "TOTALONETIMECOSTAMOUNT_T", "TOTALMONTHLYCOSTAMOUNT_T", "TOTALANNUALCOSTAMOUNT_T", "TOTALCONTRACTCOSTAMOUNT_T", "TRANSACTIONCOSTTOTAL_T", "TOTALONETIMEMARGINAMOUNT_T", "TOTALMONTHLYMARGINAMOUNT_T", "TOTALANNUALMARGINAMOUNT_T", "TOTALCONTRACTMARGINAMOUNT_T", "TRANSACTIONMARGINTOTAL_T", "TRANSACTIONMARGINPERCENT_T", "TOTALRECURREVENUE_T", "TOTALUSAGEREVENUE_T", "TOTALMONTHLYUSAGEREV_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT
    T1.bs_id bs_id  ,
    T1.CREATEDDATE_T,
    T1.ORDERDATE_T,
    T1.CONTRACTSTARTDATE_T,
    T1.CONTRACTENDDATE_T,
    T1.PRICEEXPIRATIONDATE_T,
    T1.LASTPRICEDDATE_T,
    T1.customerPartyID_t customerPartyID_t,
    T1.soldToPartyID_t soldToPartyID_t, 
    T1.shipToPartyID_t shipToPartyID_t, 
    T1.soldToCustomerAccountID_t soldToCustomerAccountID_t,
    T1.customerPartySiteID_t customerPartySiteID_t,
    T1.shipToPartySiteID_t shipToPartySiteID_t,
    T1.soldToPartySiteID_t soldToPartySiteID_t,
    T1.CURRENCY_T CURRENCY_CODE,   
    T1.opportunityID_t opportunityID_t,
    T1.transactionID_t transactionID_t,
    T1.oRCL_OSC_PrimaryOrgID_t oRCL_OSC_PrimaryOrgID_t,
    T1.oRCL_OSC_TransactionID_t oRCL_OSC_TransactionID_t,
    T1.oRCL_SFDC_TransactionID_t oRCL_SFDC_TransactionID_t,
    T2.oRCL_ERP_OrderID_t oRCL_ERP_OrderID_t,
    T2.businessUnitId_t businessUnitId_t,
    T1.winLossStatus_t winLossStatus_t  ,
    T1.winProbability_t winProbability_t ,
    T1.proposalExists_t PROPOSALEXISTS_T,
    T2.invoiceToPartyID_t INVOICETOPARTYID_T,
    T1.SYS_GEN_ID SYS_GEN_ID,
    T1.SYS_GEN_DOCUMENT_NUMBER SYS_GEN_DOCUMENT_NUMBER,
    T1.salesChannel_t SALESCHANNEL_T,
    T1.version_t version_t ,
    T2.totalContractValue_t totalContractValue_t,
    T2.totalMonthlyDiscount_t totalMonthlyDiscount_t,
    T2.totalMonthlyListAmount_t totalMonthlyListAmount_t, 
    T2.totalMonthlyNetAmount_t totalMonthlyNetAmount_t,
    T2.totalOneTimeDiscount_t totalOneTimeDiscount_t,
    T2.totalOneTimeListAmount_t totalOneTimeListAmount_t,
    T2.totalOneTimeNetAmount_t totalOneTimeNetAmount_t,
    T2.totalAnnualValue_t totalAnnualValue_t,
    T2.SYS_GEN_transaction_total SYS_GEN_transaction_total,
    T2.totalContractDiscount_t totalContractDiscount_t,
    T2.TotalAnnualDiscount_t TotalAnnualDiscount_t,
    T2.transactionTotalDiscountPercent_t transactionTotalDiscountPercent_t,
    T2.annualContractListValue_t annualContractListValue_t,
    T2.transactionListTotal_t transactionListTotal_t,
    T2.totalContractListValue_t totalContractListValue_t,
    T2.priceScore_t priceScore_t,
    T2.totalOneTimeCostAmount_t totalOneTimeCostAmount_t,
    T2.totalMonthlyCostAmount_t totalMonthlyCostAmount_t,
    T2.totalAnnualCostAmount_t totalAnnualCostAmount_t,
    T2.totalContractCostAmount_t totalContractCostAmount_t,
    T2.transactionCostTotal_t transactionCostTotal_t,
    T2.totalOneTimeMarginAmount_t totalOneTimeMarginAmount_t,
    T2.totalMonthlyMarginAmount_t totalMonthlyMarginAmount_t,
    T2.totalAnnualMarginAmount_t totalAnnualMarginAmount_t,
    T2.totalContractMarginAmount_t totalContractMarginAmount_t,
    T2.transactionMarginTotal_t transactionMarginTotal_t,
    T2.transactionMarginPercent_t transactionMarginPercent_t,
    T2.totalRecurRevenue_t totalRecurRevenue_t,
    T2.totalUsageRevenue_t totalUsageRevenue_t,
    T2.totalMonthlyUsageRev_t totalMonthlyUsageRev_t
    
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1,
    OAX$OAC.DW_CPQ_X_QUOTE_DA2 T2
WHERE 
    T1.bs_id = T2.bs_id (+)
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_F" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_FULLFILL_STATUS_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_FULLFILL_STATUS_D" ("BS_ID", "FULFILLMENTSTATUS_T", "DEFAULTREQUESTDATE_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.bs_id bs_id,
    T2.fulfillmentStatus_t fulfillmentStatus_t,
    T2.defaultRequestDate_t defaultRequestDate_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1,
    OAX$OAC.DW_CPQ_X_QUOTE_DA2 T2
WHERE 
    T1.bs_id = T2.bs_id (+)
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_FULLFILL_STATUS_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_LASTPRICE_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_LASTPRICE_DATE_D" ("LASTPRICEDDATE_T", "CREATED_DATE_KEY", "CREATED_WEEK_NUM", "CREATED_WEEK_KEY", "CREATED_MONTH_NUM", "CREATED_MONTH_NAME", "CREATED_MONTH_KEY", "CREATED_QUARTER_NUM", "CREATED_QUARTER_NAME", "CREATED_QUARTER_KEY", "CREATED_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.LASTPRICEDDATE_T,
    EXTRACT(YEAR FROM LASTPRICEDDATE_T)*10000 + EXTRACT(MONTH FROM LASTPRICEDDATE_T)*100 + EXTRACT(DAY FROM LASTPRICEDDATE_T) CREATED_DATE_KEY,
    TO_CHAR( LASTPRICEDDATE_T, 'WW') CREATED_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM LASTPRICEDDATE_T)) || 'W' || TO_CHAR( LASTPRICEDDATE_T, 'WW') CREATED_WEEK_KEY,
    EXTRACT(MONTH FROM LASTPRICEDDATE_T) CREATED_MONTH_NUM,
    TO_CHAR(LASTPRICEDDATE_T, 'MONTH') CREATED_MONTH_NAME,
    EXTRACT(YEAR FROM LASTPRICEDDATE_T)*100 + EXTRACT(MONTH FROM LASTPRICEDDATE_T)   CREATED_MONTH_KEY,
    TO_CHAR(LASTPRICEDDATE_T,'Q') CREATED_QUARTER_NUM,
    'Q' || TO_CHAR(LASTPRICEDDATE_T,'Q') CREATED_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM LASTPRICEDDATE_T)) || 'Q' || TO_CHAR(LASTPRICEDDATE_T,'Q') CREATED_QUARTER_KEY,
    EXTRACT(YEAR FROM LASTPRICEDDATE_T) CREATED_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_LASTPRICE_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_OPPORTUNITY_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_OPPORTUNITY_D" ("OPPORTUNITYID_T", "OPPORTUNITYNAME_T", "OPPORTUNITYNUMBER_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.opportunityID_t opportunityID_t,
    T1.opportunityName_t opportunityName_t,
    T1.opportunityNumber_t opportunityNumber_t 
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_OPPORTUNITY_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_ORDER_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_ORDER_DATE_D" ("ORDERDATE_T", "ORDER_DATE_KEY", "ORDER_WEEK_NUM", "ORDER_WEEK_KEY", "ORDER_MONTH_NUM", "ORDER_MONTH_NAME", "ORDER_MONTH_KEY", "ORDER_QUARTER_NUM", "ORDER_QUARTER_NAME", "ORDER_QUARTER_KEY", "ORDER_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.ORDERDATE_T,
    EXTRACT(YEAR FROM ORDERDATE_T)*10000 + EXTRACT(MONTH FROM ORDERDATE_T)*100 + EXTRACT(DAY FROM ORDERDATE_T) ORDER_DATE_KEY,
    TO_CHAR( ORDERDATE_T, 'WW') ORDER_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM ORDERDATE_T)) || 'W' || TO_CHAR( ORDERDATE_T, 'WW') ORDER_WEEK_KEY,
    EXTRACT(MONTH FROM ORDERDATE_T) ORDER_MONTH_NUM,
    TO_CHAR(ORDERDATE_T, 'MONTH') ORDER_MONTH_NAME,
    EXTRACT(YEAR FROM ORDERDATE_T)*100 + EXTRACT(MONTH FROM ORDERDATE_T)   ORDER_MONTH_KEY,
    TO_CHAR(ORDERDATE_T,'Q') ORDER_QUARTER_NUM,
    'Q' || TO_CHAR(ORDERDATE_T,'Q') ORDER_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM ORDERDATE_T)) || 'Q' || TO_CHAR(ORDERDATE_T,'Q') ORDER_QUARTER_KEY,
    EXTRACT(YEAR FROM ORDERDATE_T) ORDER_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_ORDER_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_OSC_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_OSC_D" ("ORCL_OSC_PRIMARYORGID_T", "ORCL_OSC_OWNERRESOURCEPARTYID_T", "ORCL_OSC_TRANSACTIONID_T", "ORCL_OSC_STATUS_T", "ORCL_OSC_SYNCTIME_T", "CONTRACTSTARTDATE_T", "CONTRACTENDDATE_T", "PROPOSALEXISTS_T", "RENEWALPROCESSUSED_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.oRCL_OSC_PrimaryOrgID_t oRCL_OSC_PrimaryOrgID_t,
    T1.oRCL_OSC_OwnerResourcePartyID_t oRCL_OSC_OwnerResourcePartyID_t,
    T1.oRCL_OSC_TransactionID_t oRCL_OSC_TransactionID_t,
    T1.oRCL_OSC_Status_t oRCL_OSC_Status_t,
    T1.oRCL_OSC_SyncTime_t oRCL_OSC_SyncTime_t,
    T1.contractStartDate_t contractStartDate_t,
    T1.contractEndDate_t contractEndDate_t,
    T1.proposalExists_t proposalExists_t,
    T1.renewalProcessUsed_t renewalProcessUsed_t 
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_OSC_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_PRICEEXPIRATIONDATE_DATE_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_PRICEEXPIRATIONDATE_DATE_D" ("PRICEEXPIRATIONDATE_T", "PRICEEXPIRATIONDATE_DATE_KEY", "PRICEEXPIRATIONDATE_WEEK_NUM", "PRICEEXPIRATIONDATE_WEEK_KEY", "PRICEEXPIRATIONDATE_MONTH_NUM", "PRICEEXPIRATIONDATE_MONTH_NAME", "PRICEEXPIRATIONDATE_MONTH_KEY", "PRICEEXPIRATIONDATE_QUARTER_NUM", "PRICEEXPIRATIONDATE_QUARTER_NAME", "PRICEEXPIRATIONDATE_QUARTER_KEY", "PRICEEXPIRATIONDATE_YEAR") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    --T1.CREATEDBY_T ,
    T1.PRICEEXPIRATIONDATE_T,
    EXTRACT(YEAR FROM PRICEEXPIRATIONDATE_T)*10000 + EXTRACT(MONTH FROM PRICEEXPIRATIONDATE_T)*100 + EXTRACT(DAY FROM PRICEEXPIRATIONDATE_T) PRICEEXPIRATIONDATE_DATE_KEY,
    TO_CHAR( PRICEEXPIRATIONDATE_T, 'WW') PRICEEXPIRATIONDATE_WEEK_NUM,
    TO_CHAR(EXTRACT(YEAR FROM PRICEEXPIRATIONDATE_T)) || 'W' || TO_CHAR( PRICEEXPIRATIONDATE_T, 'WW') PRICEEXPIRATIONDATE_WEEK_KEY,
    EXTRACT(MONTH FROM PRICEEXPIRATIONDATE_T) PRICEEXPIRATIONDATE_MONTH_NUM,
    TO_CHAR(PRICEEXPIRATIONDATE_T, 'MONTH') PRICEEXPIRATIONDATE_MONTH_NAME,
    EXTRACT(YEAR FROM PRICEEXPIRATIONDATE_T)*100 + EXTRACT(MONTH FROM PRICEEXPIRATIONDATE_T)   PRICEEXPIRATIONDATE_MONTH_KEY,
    TO_CHAR(PRICEEXPIRATIONDATE_T,'Q') PRICEEXPIRATIONDATE_QUARTER_NUM,
    'Q' || TO_CHAR(PRICEEXPIRATIONDATE_T,'Q') PRICEEXPIRATIONDATE_QUARTER_NAME,
    TO_CHAR(EXTRACT(YEAR FROM PRICEEXPIRATIONDATE_T)) || 'Q' || TO_CHAR(PRICEEXPIRATIONDATE_T,'Q') PRICEEXPIRATIONDATE_QUARTER_KEY,
    EXTRACT(YEAR FROM PRICEEXPIRATIONDATE_T) PRICEEXPIRATIONDATE_YEAR
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_PRICEEXPIRATIONDATE_DATE_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_SFDC_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_SFDC_D" ("ORCL_SFDC_USERID_T", "ORCL_SFDC_TRANSACTIONID_T", "ORCL_SFDC_STAGE_T", "ORCL_SFDC_CLOSEDATE_T", "ORCL_OSC_SYNCTIMEORCL_SFDC_PROBABILITY_T") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.oRCL_SFDC_UserID_t oRCL_SFDC_UserID_t,
    T1.oRCL_SFDC_TransactionID_t oRCL_SFDC_TransactionID_t,
    T1.oRCL_SFDC_Stage_t oRCL_SFDC_Stage_t,
    T1.oRCL_SFDC_CloseDate_t oRCL_SFDC_CloseDate_t,
    T1.oRCL_SFDC_Probability_t oRCL_OSC_SyncTimeoRCL_SFDC_Probability_t
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_SFDC_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_SHIPTO_CUSTOMER_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_SHIPTO_CUSTOMER_D" ("SHIPTOPARTYID_T", "SYS_GEN_SHIPTO_T_COMPANY_NAME", "SYS_GEN_SHIPTO_T_COMPANY_NAME_2") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.shipToPartyID_t shipToPartyID_t, 
    T1.SYS_GEN_soldTo_t_company_name SYS_GEN_shipTo_t_company_name, 
    T1.SYS_GEN_shipTo_t_company_name_2 SYS_GEN_shipTo_t_company_name_2
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_SHIPTO_CUSTOMER_D" TO "OAX$OAC";
--------------------------------------------------------
--  DDL for View V_DW_CPQ_X_QUOTE_SOLDTO_CUSTOMER_D
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."V_DW_CPQ_X_QUOTE_SOLDTO_CUSTOMER_D" ("SOLDTOPARTYID_T", "SYS_GEN_SOLDTO_T_COMPANY_NAME", "SYS_GEN_SOLDTO_T_COMPANY_NAME_2") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT DISTINCT
    T1.soldToPartyID_t soldToPartyID_t, 
    T1.SYS_GEN_soldTo_t_company_name SYS_GEN_soldTo_t_company_name,
    T1.SYS_GEN_customer_t_company_name_2 SYS_GEN_soldTo_t_company_name_2 
FROM
    OAX$OAC.DW_CPQ_X_QUOTE_DA1 T1
;
  GRANT SELECT ON "OAX_USER"."V_DW_CPQ_X_QUOTE_SOLDTO_CUSTOMER_D" TO "OAX$OAC";
